<?php
class Api_Model_Thucdon extends Zend_Db_Table_Abstract
{
	protected $_name="os_dmhanghoadvngay";
	protected $_primary="Id";

	var $Id, $Ngay, $IdHangHoaDV, $SoLuong, $TrangThai; 

	public function __construct() {
		$this->_name = Zend_Registry::get('tablePrefix') . $this->_name;

		parent::__construct();
	}
	
	public function GetAllDsThucdontheongay()
	{
	    $query = $this->_db->select()
	   			 		->from(array('T1'=>'os_dmhanghoadvngay'))
	    				->joinLeft(array('T2' => 'os_dmhanghoadv'), 'T1.IdHangHoaDV = T2.Id', array('T2.Ten'))
	    				->where("Ngay = '$this->Ngay'");
	     
	    $stmt = $this->_db->query($query);
	    return $result = $stmt->fetchAll();
	}
}